/*    */ package com.iris.egrantweb.struts2.interceptor;
/*    */ 
/*    */ import com.opensymphony.xwork2.ActionInvocation;
/*    */ import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
/*    */ import com.opensymphony.xwork2.util.logging.Logger;
/*    */ import com.opensymphony.xwork2.util.logging.LoggerFactory;
/*    */ import java.util.Locale;
/*    */ import org.springframework.context.i18n.LocaleContextHolder;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class IrisI18nInterceptor
/*    */   extends AbstractInterceptor
/*    */ {
/*    */   public static final String DEFAULT_PARAMETER = "locale";
/* 23 */   protected static final Logger LOG = LoggerFactory.getLogger(IrisI18nInterceptor.class);
/*    */   
/*    */   private static final long serialVersionUID = -2508727215373833285L;
/*    */   
/* 27 */   protected String parameterName = "locale";
/*    */   
/*    */   public IrisI18nInterceptor() {
/* 30 */     if (LOG.isDebugEnabled()) {
/* 31 */       LOG.debug("new I18nInterceptor()", new String[0]);
/*    */     }
/*    */   }
/*    */   
/*    */   public void setParameterName(String parameterName) {
/* 36 */     this.parameterName = parameterName;
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   public String intercept(ActionInvocation invocation) throws Exception {
/* 45 */     Locale locale = LocaleContextHolder.getLocale();
/*    */     
/* 47 */     saveLocale(invocation, locale);
/*    */     
/* 49 */     String result = invocation.invoke();
/*    */     
/* 51 */     return result;
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   protected void saveLocale(ActionInvocation invocation, Locale locale) {
/* 63 */     invocation.getInvocationContext().setLocale(locale);
/*    */   }
/*    */ }


/* Location:              D:\文件kjt\WEB-INF\lib\egrant-core-2.2.20240205.1659.jar!\com\iris\egrant\web\struts2\interceptor\IrisI18nInterceptor.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */